// index.js
const defaultAvatarUrl = 'https://mmbiz.qpic.cn/mmbiz/icTdbqWNOwNRna42FI242Lcia07jQodd2FJGIYQfG0LAJGFxM4FbnQP6yfMxBgJ0F3YRqJCJ1aPAK2dQagdusBZg/0'
import { createLoadData, createLoadPage } from '@/utils/load'
import { corpLogin } from '@/request/api/index'
import { sleep } from '@/utils/util'

Page({
  data: {
   
  },

  onLoad() {
    const [loadData, refresh] = createLoadData.call(this, async function () {
      await sleep(5000)
      console.log(this)

      return '错误'
    })

    const [loadPage, refreshPage] = createLoadPage.call(this, async function (page, count) {
      await sleep(3000)

      console.log(page, count)

      return page === 5 ? 3 : 20
    })

    Object.assign(this, { loadData, refresh, loadPage, refreshPage })
  }
 
})
